Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Functions


Binding and Unbinding Endpoints

Binding an endpoint is the process of assigning an address to it. An address is the value by which a provider's highest-layer protocol module identifies the endpoint. For example, in AppleTalk, the protocol address of an ADSP endpoint is its network ID, node ID, and DDP socket number; in TCP/IP, the protocol address of a UDP endpoint is its port number and IP address. An endpoint must have a protocol address to transfer information.

You assign an address to an endpoint by calling the OTBind function. After binding, connectionless endpoints can send and receive data; connection-oriented endpoints can send and receive connection requests. If you use the OTAccept function (page 3-127) to pass off a connection request to another endpoint, it is not necessary to bind that endpoint first.

An endpoint can be bound to only one address at a time. If you no longer need to use an endpoint or if you want to change its address, you can unbind the endpoint using the OTUnbind function. In this case, Open Transport dissociates the endpoint from the address assigned to it. After the endpoint is unbound, you can close the endpoint using the OTCloseProvider function, or you can bind the endpoint to another address by using the OTBind function. You should not assume, after unbinding an endpoint, that you can bind the endpoint again to its former address. Of course, you can request the previous address when calling the OTBind function.

IMPORTANT
You must not close an endpoint during binding and unbinding; closing an endpoint deallocates memory reserved for it and the structures it uses.

Subtopics
OTBind
OTUnbind

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996